package part1;

public class HomeCinemaFacade {
    // 定义各个子系统的对象
    private CinemaLighting cinemaLighting; // 灯光
    private Popcorn popcorn; // 爆米花机
    private Stereo stereo; // 立体声
    private Projector projector; // 投影仪
    private Screen screen; // 屏幕
    private DVDPlayer dvdPlayer; // 播放器

    public HomeCinemaFacade() {
        cinemaLighting = CinemaLighting.getInstance();
        popcorn = Popcorn.getInstance();
        stereo = Stereo.getInstance();
        projector = Projector.getInstance();
        screen = Screen.getInstance();
        dvdPlayer = DVDPlayer.getInstance();
    }

    public void ready() {
        popcorn.on();
        popcorn.pop();
        screen.down();
        projector.on();
        stereo.on();
        dvdPlayer.on();
    }

    public void play() {
        cinemaLighting.down();
        dvdPlayer.player();
    }

    public void pause() {
        cinemaLighting.up();
        dvdPlayer.pause();
    }

    public void end() {
        popcorn.off();
        cinemaLighting.up();
        dvdPlayer.off();
        projector.off();
        screen.up();
        stereo.off();
    }
}
